﻿//==================================================================
// Copyright (C) 2015 
// 作 者：
// Email: 
// 日 期：
// 描 述：
// 版 本：1.0.0.0    
//    
//==================================================================

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace FL.Aspose
{
    public class FieldEntity
    {
        
        /// <summary>
        /// 字段索引号
        /// </summary>
        private int _index;
        /// <summary>
        /// 字段索引号
        /// </summary>
        public int Index
        {
            get { return _index; }
            set { _index = value; }
        }

        /// <summary>
        /// 字段名称
        /// </summary>
        private string _fieldName;
        /// <summary>
        /// 字段名称
        /// </summary>
        public string FieldName
        {
            get { return _fieldName; }
            set { _fieldName = value; }
        }

        /// <summary>
        /// 字段中文名称
        /// </summary>
        private string _fieldCNName;
        /// <summary>
        /// 字段中文名称
        /// </summary>
        public string FieldCNName
        {
            get { return _fieldCNName; }
            set { _fieldCNName = value; }
        }

        /// <summary>
        /// 别名
        /// </summary>
        private string _alias;
        /// <summary>
        /// 别名
        /// </summary>
        public string Alias
        {
            get { return _alias; }
            set { _alias = value; }
        }

        private int _filedLength;
        /// <summary>
        /// 字段长度
        /// </summary>
        public int FiledLength
        {
            get { return _filedLength; }
            set { _filedLength = value; }
        }

        /// <summary>
        /// 导出转换字段
        /// </summary>
        private string _ExportFiled;
        /// <summary>
        /// 导出转换字段
        /// </summary>
        public string ExportFiled
        {
            get { return _ExportFiled; }
            set { _ExportFiled = value; }
        }

        /// <summary>
        /// 字段类型
        /// </summary>
        private string _fieldType;
        /// <summary>
        /// 字段类型
        /// </summary>
        public string FieldType
        {
            get { return _fieldType; }
            set { _fieldType = value; }
        }

        /// <summary>
        /// 是否为主键
        /// </summary>
        private bool _isKey;
        /// <summary>
        /// 是否为主键
        /// </summary>
        public bool IsKey
        {
            get { return _isKey; }
            set { _isKey = value; }
        }

        /// <summary>
        /// 是否可为空
        /// </summary>
        private bool _isNullAble;
        /// <summary>
        /// 是否可为空
        /// </summary>
        public bool IsNullAble
        {
            get { return _isNullAble; }
            set { _isNullAble = value; }
        }

        /// <summary>
        /// 校验规则
        /// </summary>
        private string _checkRule;

        /// <summary>
        /// 校验规则
        /// </summary>
        public string CheckRule
        {
            get { return _checkRule; }
            set { _checkRule = value; }
        }

        /// <summary>
        /// 选中状态
        /// </summary>
        private bool _selected = true;
        /// <summary>
        /// 选中状态
        /// </summary>
        public bool Selected
        {
            get { return _selected; }
            set { _selected = value; }
        }
        /// <summary>
        /// 匹配字段
        /// </summary>
        private FieldEntity _matchFieldEntity;
        /// <summary>
        /// 匹配字段
        /// </summary>
        public FieldEntity MatchFieldEntity
        {
            get { return _matchFieldEntity; }
            set { this._matchFieldEntity = value; }
        }

        /// <summary>
        /// 候选匹配字段
        /// </summary>
        private ObservableCollection<FieldEntity> _fieldEntitys;
        /// <summary>
        /// 候选匹配字段
        /// </summary>
        public ObservableCollection<FieldEntity> FieldEntitys
        {
            get { return _fieldEntitys; }
            set
            {
                this._fieldEntitys = value;

            }
        }

        /// <summary>
        /// 检测方式
        /// 检测方式
        /// 0=不检测，
        /// 1=正则表达式， CHECKRULE存储正则表达式，
        /// 2=枚举类型 CHECKRULE存储，枚举字段，逗号分隔，
        /// 3=枚举类型 CHECKRULE存储，枚举字段的SQL语句
        /// </summary>
        public int CheckType
        {
            get;
            set;
        }
        /// <summary>
        /// 枚举类型列表
        /// </summary>
        public List<string> EnumList
        {
            get;
            set;
        }
        /// <summary>
        /// 备注：记录错误或者其他
        /// </summary>
        public string Remark
        {
            get;
            set;
        }      

    }
}
